﻿using Expect.VisualStudio.Extensions;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Tagging;

namespace Expect.Vs2010.Extensions.Tagging
{
    class FixtureTag : IFixtureTag
    {
        public SelectionResolution Resolution { get; set; }

        public ITrackingSpan Span { get; private set; }

        public FixtureTag(SnapshotSpan span, SelectionResolution resolution)
        {
            Span = span.Snapshot.CreateTrackingSpan(span, SpanTrackingMode.EdgeExclusive);
            Resolution = resolution;
        }

        public ITagSpan<IFixtureTag> ToTagSpan(ITextSnapshot snapshot)
        {
            return new TagSpan<IFixtureTag>(Span.GetSpan(snapshot), this);
        }
    }
}
